package Collection.CollectionMethod.contains;


import java.util.ArrayList;
import java.util.Collection;

public class ContainsDemo {
    /**
     * contain 是Collection集合的方法，他是查看集合中是否有这个元素
     * @param args
     */
    public static void main(String[] args) {
        Collection<Integer> list = new ArrayList<>();
        ArrayList<Integer> arrays = new ArrayList();
        arrays.add(1);
        arrays.add(2);
        list.addAll(arrays);
        System.out.println(list);
        System.out.println(list.contains(1));
        System.out.println(list.contains(3));
    }
}
